package com.ruoyi.model.contest;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author ruoyi
 * @date 2024-03-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("web_contest")
public class Contest extends BaseEntity {
    private static final long serialVersionUID = 1L;


    public Contest(String id, Integer viewNum) {
        this.id = id;
        this.viewNum = viewNum;
    }

    /**
     * 主键id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 竞赛标题
     */
    @Excel(name = "竞赛标题")
    @ApiModelProperty("活动标题")
    private String title;

    /**
     * 竞赛描述
     */
    @Excel(name = "竞赛描述")
    @ApiModelProperty("竞赛描述")
    private String description;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("发布竞赛时间")
    private Date pushTime;

    /**
     * 排序字段
     */
    @ApiModelProperty("排序")
    private Integer sort;

    /**
     * 允许参加的竞赛人数
     */
    @Excel(name = "允许参加的竞赛人数")
    @ApiModelProperty("允许参加的竞赛人数")
    private Long personNum;

    @ApiModelProperty("发布者姓名")
    private String pushName;

    /**
     * 内容详情
     */
    @Excel(name = "内容详情")
    @ApiModelProperty("内容详情")
    private String content;

    /**
     * 封面路径
     */
//    @Excel(name = "图片id")
    @ApiModelProperty("封面")
    private String cover;

    /**
     * 活动地址
     */
    @Excel(name = "活动地址")
    @ApiModelProperty("活动地址")
    private String local;

    /**
     * 是否允许提交电子档
     */
    @Excel(name = "是否允许提交电子档")
    @ApiModelProperty("是否允许提交电子档")
    private String isEmail;

    /**
     * 是否收费
     */
    @Excel(name = "是否收费")
    @ApiModelProperty("是否收费")
    private String isToll;

    /**
     * 收取费用
     */
    @Excel(name = "收取费用")
    @ApiModelProperty("收取费用")
    private BigDecimal toll;

    /**
     * 竞赛开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "竞赛开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("竞赛开始时间")
    private Date startDate;

    /**
     * 竞赛结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "竞赛结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("竞赛结束时间")
    private Date endDate;

    /**
     * 主办方
     */
    @Excel(name = "主办方")
    @ApiModelProperty("主办方")
    private String organizer;

    /**
     * 发布者id
     */
    @Excel(name = "发布者id")
    @ApiModelProperty("发布者id")
    private String pushId;

    /**
     * 分类id
     */
    @Excel(name = "分类id")
    @ApiModelProperty("分类id")
    private String categoryId;

    /**
     * 报名开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "报名开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("报名开始时间")
    private Date enrollStartDate;

    /**
     * 报名结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "报名结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("报名结束时间")
    private Date enrollEndDate;

    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty("已经报名人数")
    private Long participationNum;

    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty("浏览量")
    private Integer viewNum;

    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty("是否允许评论")
    private String isComment;

    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty("是否置顶")
    private String isTop;

    /**
     * 竞赛状态
     */
    @Excel(name = "竞赛状态")
    @ApiModelProperty("竞赛状态")
    private String status;

    /**
     * 逻辑删除表示
     */
    @Excel(name = "逻辑删除表示")
    @TableLogic
    private String isDel;

    @ApiModelProperty("是否使用系统自带报名模板")
    private String isSystem;

    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty("是否允许团队参赛")
    private String isTeam;

    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty("团队参赛最大人数")
    private Long teamNum;

    @Version
    private Long version; //乐观锁


}
